package fly_weight_mode

type IgoChessmanFactory map[string]*IgoChessman

func (i IgoChessmanFactory) GetIgoChessman(t string) *IgoChessman {
	result, ok := i[t]
	if !ok {
		result = NewIgoChessman(t)
		i[t] = result
	}
	return result
}

var maps IgoChessmanFactory

func NewIgoChessmanFactory() {
	if maps == nil {
		maps = make(map[string]*IgoChessman, 0)
	}
}
